<?php
/**
 * Created by PhpStorm.
 * User: david
 * Date: 2018/5/24
 * Time: 15:15
 */

namespace app\admin\controller;


use app\admin\Controller;
use app\common\model\Site as SiteModel;

class Site extends Controller
{
    public function index()
    {
        $site = SiteModel::get(1);
        $this->view->assign('site', $site);
        return $this->view->fetch();
    }

    public function save()
    {
        $data = $this->request->param();
        SiteModel::where('id', 1)->update($data['data']);
        return [
            'code' => 0,
            'msg' => 'success'
        ];
    }
}